import { ListPage } from "custom/index";
import { getScriptManagePage } from './api'
import dayjs from 'dayjs'
import { onDutyStatusOptions, becomeRegularStatusOptions } from '@/views/menus/employee-management/constant.ts'

const page = new ListPage('MonthlyCommission');

page
  .api(getScriptManagePage)
  .useSearch()
    .addInputItem('keyword', '客服姓名/花名/工号')
    .addDatePicker({ prop: 'month', label: '月份', type: 'month', format: "YYYY-MM", valueFormat: "YYYY-MM", clearable: false, default: dayjs().format('YYYY-MM') })
    .addDictSelect({ prop: 'companyNo', label: '公司' }, 'company')
    .end()
  .useTable()
    .useIndexColumn().end()
    .useColumn('month').label('月份').minWidth(100).end()
    .useColumn('name').label('客服姓名').minWidth(140).end()
    .useColumn('flowerName').label('客服花名').minWidth(200).end()
    .useColumn('groupNo').label('客服编队').minWidth(200).end()
    .useColumn('companyName').label('公司').minWidth(140).end()
    .useColumn('customGroupName').label('客服分组').minWidth(140).end()
    .useColumn('no').label('客服工号').minWidth(140).end()
    .useColumn('customPostTypeName').label('客服岗位').minWidth(140).end()
    .useEnumColumn('onDutyStatus', onDutyStatusOptions).label('在职状态').minWidth(140).end()
    .useColumn('entryDate').label('入职时间').minWidth(140).end()
    .useEnumColumn('becomeRegularStatus', becomeRegularStatusOptions).label('转正状态').minWidth(140).end()
    .useColumn('becomeRegulardDate').label('转正日期').minWidth(160).end()
    .useColumn('baseProfit').label('底薪效益').minWidth(140).end()
    .useColumn('commissionProfit').label('提成效益').minWidth(140).end()
    // .useColumn('sumProfit').label('加班效益').minWidth(180).end()
    .useColumn('sumProfit').label('效益合计').minWidth(140).end()
    .useColumn('base').label('基数').minWidth(140).end()
    .useColumn('coefficient').label('比例').minWidth(140).end()
    .useColumn('commissionSalary').label('提成工资').minWidth(140).end()
    .end()
  .usePagination()
    .end()
  .useAuthButton()
    .useItem('export').content('导出数据').exportExcel().end()
    .end()

export default page
